/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Util;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
/**
 *
 * @author Contagem
 */
public class Conexao extends Dados {
    
    public static Connection cn;
    public static Statement stmt;
    public static ResultSet rs;
    public static CallableStatement cs;
    
    public static void IniciarConexao() throws SQLException
    {
           try {
                Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            } catch (ClassNotFoundException ex) {
                JOptionPane.showMessageDialog(null, "Driver de Conexão não encontrado");
            }
           
           cn = DriverManager.getConnection(StringdeConexao());
           stmt = cn.createStatement();
    }
    
    public static void FecharConexao()
    {
    
        cn = null;
        stmt = null;
    }
}
